For Kant, morality is an act of the will, where we take positive steps to do what is good. As it is an act of the 'good will' which occurs through 'pure practical reason'.

In order to develop his theory, Kant needed to develop an understanding of the principles upon which the 'good will' is found. To do this, and after some heavy objective thinking, Kant developed a test that he thought could tell us whether an action is in accordance with 'pure practical reason'. He called this test the Categorical Imperative.

Why 'Categorical Imperative'?

The word categorical here means 'in all cases'. The word imperative means something that must be done. The phrase categorical imperative, therefore, means an act that we have a complete moral obligation to do. Something that does not depend on an outcome or consequence, but only on the good will through practical reason that tells us what we 'ought' to do. So a categorical imperative is an end in itself, and is the basis for all action.
To work out whether or not an act is the right thing to do, Kant said:

"Act only according to that maxim whereby you can at the same time 'will' that it should become a universal law"